package com.tian.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value="/welcome")
public class HelloController {
	
//	@RequestMapping(method=RequestMethod.GET)
//	public String printHello1(ModelMap map){
//		map.addAttribute("message", "Spring MVC Hello 1 ");
//		return "hello";
//	}
	
	@RequestMapping(method=RequestMethod.GET)
	@ResponseBody  //responseBody直接返回数据，不转向页面
	public String printHello(ModelMap map){
		map.addAttribute("message", "Spring MVC Hello ");
		return "hello";
	}
	

}
